/* 
    服务管理(lb) 服务列表展开的子table(应用容器实例列表)
 */
 <template>
    <!--扩展的数据列表-->
    <el-table :show-header="true" :data="resourceC" style="width: 100%;" class="extend">
        <el-table-column prop="appNameKube" label="应用实例(容器)"></el-table-column>
        <el-table-column prop="status" label="状态"></el-table-column>
        <el-table-column prop="restartCount" label="重启次数"></el-table-column>
        <el-table-column prop="timeDiff" label="创建时间"></el-table-column>
    </el-table>
</template>
<script>
//scope 是父组件传递过来的
export default {
    data() {
        return {
            resourceC: []
        }
    },
    props: {
        scope: Object // $index/row/store  你可以看scope 这个对象，这个页面有很多简化的 
    },
    methods: {
        //格式化列表输出
        formatter1: function(row, column, cellValue) {
            return "";
        }
    },
    mounted() {
        let ns = this.scope.row.namespace;
        let appName = this.scope.row.selectors.app;
        let url = this.projectConfig.URL_API_APP_MANAGE_GET_POD_LIST + '?namespace=' + ns + "&appKubeName=" + appName;
        this.httpClient.httpClientget(url).then((response) => {
            // 返回处理
            const code = response.meta.code;
            if (code == this.projectConfig.CODE_OK) {
                this.resourceC = response.data;
            } else {
                let errorMsg = '异常代号为:' + code + ",异常信息:" + response.meta.message;
                this.$message({
                    showClose: true,
                    message: errorMsg,
                    type: 'error'
                });
            }
        });
    }
}
</script>